From 13ef82fc4d9a245e9e925f8c86b598d62cfd1954 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 12 Jan 2021 08:18:47 -0500 Subject: [PATCH] dist: Add a dist script to generate css When I added the sassc option, I failed to ensure that the theme css is included in the tarballs. This is required to make tarball builds with -Dsassc=disabled work. --- build-aux/meson/dist-theme.py | 19 +++++++++++++++++++ meson.build | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 build-aux/meson/dist-theme.py diff --git a/build-aux/meson/dist-theme.py b/build-aux/meson/dist-theme.py new file mode 100644 index 0000000000..1582057113 --- /dev/null +++ b/build-aux/meson/dist-theme.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +import os +from pathlib import PurePath +import subprocess + +stylesheets = [ 'gtk/theme/Adwaita/Adwaita.css', + 'gtk/theme/Adwaita/Adwaita-dark.css', + 'gtk/theme/HighContrast/HighContrast.css', + 'gtk/theme/HighContrast/HighContrast-inverse.css' ] + +sourceroot = os.environ.get('MESON_SOURCE_ROOT') +distroot = os.environ.get('MESON_DIST_ROOT') + +for stylesheet in stylesheets: + stylesheet_path = PurePath(stylesheet) + src = PurePath(sourceroot, stylesheet_path.with_suffix('.scss')) + dst = PurePath(distroot, stylesheet_path) + subprocess.call(['sassc', '-a', '-M', '-t', 'compact', src, dst]) diff --git a/meson.build b/meson.build index 9fe9cd5acf..3edb716efc 100644 --- a/meson.build +++ b/meson.build @@ -803,6 +803,8 @@ else message('Not executing post-install steps automatically when cross compiling') endif +meson.add_dist_script('build-aux/meson/dist-theme.py') + if host_machine.system() != 'windows' # Install Valgrind suppression files (except on Windows, # as Valgrind is currently not supported on Windows) -- 2.30.2